package com.zy.springbootmybatis.controller;


import com.zy.springbootmybatis.bean.TAdmin;
import com.zy.springbootmybatis.service.TAdminService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zy 690748807@qq.com
 * @Param:
 * @return:
 * @Date: 2023/12/10
 * @Description: 用户表增删改查是同步数据展示（页面和 数据同时出现）
 */
@Controller
public class TAdminController {
    Logger log = LoggerFactory.getLogger(TAdminController.class);
    @Autowired
    TAdminService adminService;

    @ResponseBody
    @RequestMapping("/selectByPrimaryKey/{id}")
    public TAdmin selectByPrimaryKey(@PathVariable("id") Integer id) {

        TAdmin admin = adminService.selectByPrimaryKey(id);
        log.info(admin.toString());
        return admin;
    }


}
